﻿@using Mulala.Cavan.Presentation.Seedwork
@using Mulala.Cavan.Presentation.Mvc.Controller
@using Mulala.Cavan.Domain.MainBoundedContext.DictionaryModule
@model ICorporationViewModel
@{
    ViewBag.Title = "公司信息";
    Layout = "~/Views/Shared/_CorporationCenterLayout.cshtml";
}
@section header{
    <title>@ViewBag.Title</title>
    @Styles.Render("~/Content/themes/corporationcenter")
    @Styles.Render("~/Content/themes/corporationcenter/info")
}
@*@{
    Html.RenderAction(ActionConst.PARTINFO, ControllerConst.CORPORATIONCENTER);
}
@{
    Html.RenderAction("recommendconsign", "Consign");
}
@{
    Html.RenderAction("popularproprietor", "Proprietor");
}*@
<div id="main">
    <div class="maintoptext">
        &nbsp;&nbsp;公司信息编辑</div>
    <div id="divconte">
        <div id="divyou">
            友情提示：<p>
                1、为了方便你与业主的沟通，请如实填写个人信息</p>
            <p>
                2、基本信息一旦保存，将不能再修改<a href="#">查看修改规则</a></p>
        </div>
        <p style="text-align: left;">
            &nbsp;&nbsp;&nbsp;&nbsp;基本信息</p>
    </div>
    @using (Html.BeginForm())
    {
        <div class="jiben">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="26%" align="right">
                        公司名称：
                    </td>
                    <td width="74%" align="left">
                        @Html.HiddenFor(m => m.Item.ID, new { id = "CorporationID" })
                        @Html.TextBoxFor(m => m.Item.FullName, new { id = "Name", name = "companyName", @class = "gsmin" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.FullName)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        地区：
                    </td>
                    <td align="left">
                        @Html.Action("selectarea", "area", new { cityID = @Model.CityID, townID = @Model.TownID })
                        @Html.HiddenFor(m => m.Item.Area.ID, new { id = "Area" })
                        @Html.ValidationMessageFor(m => m.Item.Area)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <p>
                            地址：</p>
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.Address, new { id = "Address", name = "address", @class = "gsmin" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.Address)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        工商注册时间：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.RegistrationTime, new { id = "RegistrationTime", name = "registered", @class = "qtatext" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.RegistrationTime)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        注册资金：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.Capital, new { id = "Capital", name = "registFunds", @class = "qtatext" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.Capital)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        营业执照：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.BusinessLicence, new { id = "BusinessLicence", name = "businessLicense", @class = "qtatext" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.BusinessLicence)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        企业性质：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.Item.Nature, DictionaryIdentifier.GroupType.CorporationNature, new { id = "Nature", name = "enterpriseNature", @class = "qyxz" })
                        &nbsp;&nbsp;
                    </td>
                </tr>
            </table>
            <p style="text-align: left;">
                &nbsp;&nbsp;&nbsp;&nbsp;公司概括</p>
        </div>
        <div class="jiben">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="26%" align="right">
                        公司类型：
                    </td>
                    <td width="74%" align="left">
                        @Html.DropDownListFor(m => m.TypeForEdit, DictionaryIdentifier.GroupType.CorporationType, new { id = "Type", name = "businessType", @class = "qyxz" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.Type)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        公司规模：
                    </td>
                    <td align="left">
                        @Html.DropDownListFor(m => m.Item.Scale, DictionaryIdentifier.GroupType.CorporationScale, new { id = "Scale", name = "businessScale", @class = "qyxz" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.Scale)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        公司主页：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.HomePage, new { id = "HomePage", name = "homepage", @class = "qtatext" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.HomePage)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        擅长服务：
                    </td>
                    <td align="left">
                        @Html.CheckBoxListFor(m => m.Specialities, DictionaryIdentifier.GroupType.CorporationSpeciality, System.Web.UI.WebControls.RepeatDirection.Horizontal)
                        @Html.HiddenFor(m => m.Speciality, new { id = "Speciality" })
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        公司文化：
                    </td>
                    <td align="left">
                        @Html.TextAreaFor(m => m.Item.Culture, new { id = "Culture", name = "businessCulture", cols = "68", rows = "8" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.Culture)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        公司介绍：
                    </td>
                    <td align="left">
                        @Html.TextAreaFor(m => m.Item.Introduce, new { id = "Introduce", name = "businessCulture", cols = "68", rows = "8" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.Introduce)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        收费说明：
                    </td>
                    <td align="left">
                        @Html.TextAreaFor(m => m.Item.ChargeDescription, new { id = "ChargeDescription", name = "chargeExplain", @class = "xheditor-simple", rows = "8", cols = "68", style = "width: 80%" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.ChargeDescription)
                    </td>
                </tr>
            </table>
            <p style="text-align: left;">
                &nbsp;&nbsp;&nbsp;&nbsp;联系信息</p>
        </div>
        <div class="jiben2">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="26%" align="right">
                        联&nbsp;&nbsp;系&nbsp;&nbsp;人：
                    </td>
                    <td width="74%" align="left">
                        @Html.TextBoxFor(m => m.Item.Contact, new { id = "Contact", name = "contact", @class = "qtatext" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.Contact)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        联系Email：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.ContactEmail, new { id = "ContactEmail", name = "email", @class = "qtatext" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.ContactEmail)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        固定电话：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.Telephone, new { id = "Telephone", name = "phone", @class = "qtatext" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.Telephone)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        手&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.Mobile, new { id = "Mobile", name = "phonest", @class = "qtatext" })
                        &nbsp;&nbsp;
                        @Html.ValidationMessageFor(m => m.Item.Mobile)
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        传&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;真：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.Fax, new { id = "Fax", name = "fax", @class = "qtatext" })
                        &nbsp;&nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        在线客服：
                    </td>
                    <td align="left">
                        @Html.TextBoxFor(m => m.Item.CustomService, new { id = "CustomService", name = "online", @class = "qtatext" })
                        &nbsp;&nbsp; 如Q769522418
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        &nbsp;
                    </td>
                    <td align="left">
                        <input type="submit" name="button" id="submit" value=" " class="submits" />
                    </td>
                </tr>
            </table>
        </div>
    }
    <br />
    <br />
</div>
@section scripts{
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/edit")
    @Scripts.Render("~/bundles/datepicker")
    <script type="text/javascript">
        $(function () {
            $("form[action$='info']").submit(function () {
                $.ajax({
                    url: this.action,
                    type: this.method,
                    data: $(this).serialize(),
                    success: function (data) {
                        if (data) {
                            alert(data.Messages[0]);
                        }
                    },
                    error: function () {
                        alert('ok');
                    }
                })

                return false;
            });

            $("input[name='Specialities']").click(function () {
                var speciality = "";
                $("input[name='Specialities']").each(function () {
                    if ($(this).attr("checked") == "checked") {
                        speciality = speciality + $(this).val() + ',';
                    }
                })
                $("#Speciality").val(speciality);
            });

            function ShowDatePicker() {
                WdatePicker({ maxDate: new Date() });
            }
            $("#RegistrationTime").click(ShowDatePicker).focus(ShowDatePicker);
        })
    </script>
}
